<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<#import "spring.ftl" as spring/>
<#assign security=JspTaglibs["http://www.springframework.org/security/tags"] />

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html">
    <link href="<@spring.url relativeUrl="/theme/style.css"/>" rel="stylesheet" type="text/css">
    <title><@spring.message code="page.content.title.project"/></title>
</head>
<body>
<#include "logo.ftl">

<div id="page">
 
<#if RequestParameters.action == "new">    
<div id="content">
    <div class="post">
        <form method="post">
            <h2 class="title"><@spring.message code="page.content.title.project.new"/></h2>
            <div class="entry">
            <p>  
            <@spring.bind "command.*"/>
            <#list spring.status.errorMessages as error>
                <font color="red">${error}</font> <br />
            </#list>          
            <table>
                <tr>
                    <td align="right" valign="top"><b><@spring.message code="page.content.form.project.name"/>:</b></td>
                    <td>
                        <@spring.bind "command.name"/>
                        <input name='${spring.status.expression}' value='${spring.status.value!""}' type="text" size="30" maxlength="50">
                    </td>
                </tr>
                <tr>
                    <td valign="right" align="top"><b><@spring.message code="page.content.form.project.persons"/>: </b></td>
                    <td>
                        <@spring.formCheckboxes "command.personsStr", personList, "<br>" />
                    </td>
                </tr>
            </table>
            <br/><br/>
            <input name="save" type="submit" value="<@spring.message code="page.content.page.button.save"/>"/>
            <input name="cancel" type="button" value="<@spring.message code="page.content.page.button.cancel"/>" onClick="javascript:window.location='projectList.htm'"/>
            </p>
            </div>
        </form>
    </div>
</div>

<div id="sidebar">
    <h2><@spring.message code="page.sidebar.title"/></h2>
    <ul><li>
        <ul>
            <li><a href="enterProject.htm?action=new"><@spring.message code="page.sidebar.new.project"/></a></li>
        </ul>
    </li></ul>
</div>

<#elseif RequestParameters.action == "edit">

<div id="content">
    <div class="post">
        <form method="post">
            <h2 class="title"><@spring.message code="page.content.title.project.edit"/></h2>
            <div class="entry">
            <p>  
            <@spring.bind "command.*"/>
            <#list spring.status.errorMessages as error>
                <font color="red">${error}</font> <br />
            </#list> 
            <table>
                <tr>
                    <td align="right" valign="top"><b><@spring.message code="page.content.form.project.id"/>:</b></td>
                    <td>${command.id}</td>
                </tr>
                <tr>
                    <td align="right" valign="top"><b><@spring.message code="page.content.form.project.name"/>:</b></td>
                    <td>
                        <@spring.bind "command.name"/>
                        <input name='${spring.status.expression}' value="${command.name}" type="text" size="30" maxlength="50">
                    </td>
                </tr>
                <tr>
                    <td valign="right" align="top"><b><@spring.message code="page.content.form.project.persons"/>:</b></td>
                    <td>
                        <@spring.formCheckboxes "command.personsStr", personList, "<br>" />
                    </td>
                </tr>
            </table>
            <br/><br/>
            <input name="save" type="submit" value="<@spring.message code="page.content.page.button.save"/>"/>
            <input name="cancel" type="button" value="<@spring.message code="page.content.page.button.cancel"/>" onClick="javascript:window.location='projectList.htm'"/>
            </p>
            </div>
        </form>
    </div>
</div>

<div id="sidebar">
    <h2><@spring.message code="page.sidebar.title"/></h2>
    <ul><li>
        <ul>
            <li><a href="enterProject.htm?action=new"><@spring.message code="page.sidebar.new.project"/></a></li>
            <li><a href="deleteProject.htm?id=${command.id}"><@spring.message code="page.sidebar.delete.project"/></a></li>
        </ul>
    </li></ul>
</div>

</#if>

<div style="clear: both;">&nbsp;</div>

</div>
    
<#include "footer.ftl">
</body>
</html>